package com.ruoyi.web.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.web.domain.NewsUpdate;
import com.ruoyi.web.mapper.NewsUpdateMapper;
import com.ruoyi.web.service.NewsUpdateService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 资讯动态表 服务实现类
 * </p>
 *
 * @author 
 * @since 2025-11-01
 */
@Service
public class NewsUpdateServiceImpl extends ServiceImpl<NewsUpdateMapper, NewsUpdate> implements NewsUpdateService {

    @Override
    public List<NewsUpdate> selectList() {
        return this.list(new LambdaQueryWrapper<NewsUpdate>().orderByDesc(NewsUpdate::getPublishTime));
    }

    @Override
    public boolean insertRecord(NewsUpdate newsUpdate) {
        return this.save(newsUpdate);
    }

    @Override
    public boolean updateRecord(NewsUpdate newsUpdate) {
        return this.updateById(newsUpdate);
    }

    @Override
    public boolean deleteRecord(Long baseId) {
        return this.removeById(baseId);
    }

    @Override
    public NewsUpdate detail(Long baseId) {
        return this.getById(baseId);
    }
}
